(function(){
    function $$(element){
        return document.querySelector(element);
    }
    //简历轮播图函数
    ;(function(){
        let aTableList = $$('#lt-tablist')
        let aRightTab = $$('.rightTab')
         
        let oLeftitems = aTableList.getElementsByTagName('li')
        let ocontents = aRightTab.getElementsByTagName('section')
        // console.log(oLeftitems.length,ocontents.length)
        let addClass = 'show' 
        for(let i = 0,len = oLeftitems.length;i<len;i++){
            oLeftitems[i].onclick = function(){
                let that = this;
				/*给所有的标签都去除样式*/
                for(let j=0,len = ocontents.length;j<len;j++){
                    ocontents[j].classList.remove(addClass)
                    oLeftitems[j].classList.remove('active')
                }
				// 选中的标签加上样式
                ocontents[i].classList.add(addClass)
                this.classList.add('active')
            }
        }
    })()
    //标签云函数
    ;(function(){
        let tagCould = $$('#skill-tag');
        let aTagWords = tagCould.getElementsByTagName('span')
        // console.log(aTagWords)
        function randomInt(max){
            return parseInt(Math.random()*max);
        }
        for(let i=0,len=aTagWords.length;i<len;i++ ){
            aTagWords[i].style.fontSize = (Math.random()+ 0.8) + 'em';
            aTagWords[i].style.color = 'rgb('+randomInt(255)+','+randomInt(255)+','+randomInt(255)+')'
        }
    })()
    
}).call()